/* 连接管理页面现代化样式 */
.connections-page {
  padding: 0;
  min-height: 100%;
  background: var(--color-background);
  position: relative;
}

/* 页面标题区域 */
.connections-page .ant-card-head {
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  position: relative;
}

.connections-page .ant-card-head::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.connections-page .ant-card-head:hover::before {
  opacity: 1;
}

.connections-page .ant-card-head-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.connections-page .ant-card-head-title::before {
  content: '🔗';
  font-size: 20px;
}

.connections-page .ant-card-extra {
  margin: 0;
}

.connections-page .ant-card-extra .ant-space {
  gap: 12px;
}

.connections-page .ant-card-extra .ant-btn {
  height: 32px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.connections-page .ant-card-extra .ant-btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border: none;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.connections-page .ant-card-extra .ant-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.connections-page .ant-card-extra .ant-btn-default {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.connections-page .ant-card-extra .ant-btn-default:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-1px);
}

/* 卡片主体内容 */
.connections-page .ant-card-body {
  padding: 24px;
  background: var(--color-background);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.connections-content {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.connections-content p {
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin: 8px 0;
  opacity: 0.8;
}

/* 搜索框样式优化 */
.connections-search {
  margin-bottom: 24px;
  position: relative;
}

.connections-search .ant-input {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 14px;
  padding: 0 16px 0 44px;
  transition: all 0.2s ease;
}

.connections-search .ant-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.connections-search .ant-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(102, 126, 234, 0.2);
}

.connections-search .ant-input-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  opacity: 0.6;
  z-index: 1;
}

/* 空状态优化 */
.connections-empty {
  text-align: center;
  padding: 60px 20px;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.connections-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.7;
  display: block;
}

.connections-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.connections-empty-description {
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .connections-page .ant-card-head {
    padding: 12px 16px;
  }

  .connections-page .ant-card-head-title {
    font-size: 16px;
  }

  .connections-page .ant-card-extra .ant-btn {
    height: 28px;
    font-size: 12px;
    padding: 0 8px;
  }

  .connections-page .ant-card-extra .ant-space {
    gap: 8px;
  }

  .connections-page .ant-card-body {
    padding: 16px;
  }

  .connections-content {
    max-width: 100%;
  }

  .connections-empty {
    padding: 40px 16px;
  }

  .connections-empty-icon {
    font-size: 48px;
  }
}

@media (max-width: 480px) {
  .connections-page .ant-card-extra .ant-btn span {
    display: none;
  }

  .connections-page .ant-card-extra .ant-btn {
    padding: 0 8px;
    min-width: 32px;
    justify-content: center;
  }
}

/* 深色主题适配 */
[data-theme="dark"] .connections-page .ant-card-head {
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(0, 0, 0, 0.2) 100%);
}

[data-theme="dark"] .connections-page .ant-card-body {
  background: var(--color-background);
}

[data-theme="dark"] .connections-search .ant-input {
  background: rgba(0, 0, 0, 0.2);
  border-color: var(--color-border);
}

[data-theme="dark"] .connections-search .ant-input:focus {
  background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .connections-page .ant-card-extra .ant-btn-default {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--color-border);
}

[data-theme="dark"] .connections-page .ant-card-extra .ant-btn-default:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* 加载动画 */
.connections-page.loading .ant-card-body {
  opacity: 0.6;
  pointer-events: none;
}

.connections-page.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* 筛选器样式 */
.connections-filters {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

[data-theme="dark"] .connections-filters {
  background: rgba(0, 0, 0, 0.2);
}

/* 连接列表样式 */
.connection-list {
  width: 100%;
}

.connection-group {
  margin-bottom: 24px;
}

.connection-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-weight: 500;
}

[data-theme="dark"] .connection-group-header {
  background: rgba(0, 0, 0, 0.2);
}

.connection-group-name {
  font-size: 16px;
  color: var(--color-text);
}

.connection-group-count {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.connection-list-item {
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.connection-list-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.connection-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 0;
}

.connection-item-main {
  flex: 1;
}

.connection-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.connection-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.connection-item-icon {
  font-size: 20px;
}

.connection-item-name {
  flex: 1;
}

.connection-item-status {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.connection-item-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.connection-item-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.connection-item-label {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.connection-item-value {
  color: var(--color-text);
  font-weight: 500;
}

.connection-item-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.connection-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
}

.connection-empty h3 {
  margin: 16px 0 8px;
  color: var(--color-text);
}

.connection-empty p {
  font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .connection-item-body {
    grid-template-columns: 1fr;
  }
}